package provatable;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the CONTENUTO_MULTIMEDIALE database table.
 * 
 */
@Entity
@Table(name="CONTENUTO_MULTIMEDIALE")
@NamedQuery(name="ContenutoMultimediale.findAll", query="SELECT c FROM ContenutoMultimediale c")
public class ContenutoMultimediale implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private long oid;

	private String tag;

	private String url;

	//bi-directional many-to-one association to User
	@OneToMany(mappedBy="contenutoMultimediale")
	private List<User> users;

	public ContenutoMultimediale() {
	}

	public long getOid() {
		return this.oid;
	}

	public void setOid(long oid) {
		this.oid = oid;
	}

	public String getTag() {
		return this.tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<User> getUsers() {
		return this.users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

	public User addUser(User user) {
		getUsers().add(user);
		user.setContenutoMultimediale(this);

		return user;
	}

	public User removeUser(User user) {
		getUsers().remove(user);
		user.setContenutoMultimediale(null);

		return user;
	}

}